package Eyjafjalla.card.skill;

import Eyjafjalla.action.*;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.card.status.Burn_Eyjafjalla;
import Eyjafjalla.modcore.EyjafjallaTag;
import com.badlogic.gdx.graphics.Color;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.actions.common.GainEnergyAction;
import com.megacrit.cardcrawl.actions.common.MakeTempCardInDiscardAction;
import com.megacrit.cardcrawl.actions.unique.ExpertiseAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.status.Burn;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.DrawCardNextTurnPower;
import com.megacrit.cardcrawl.powers.watcher.VigorPower;

import java.util.ArrayList;

public class FireOfLove_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "FireOfLove_Eyjafjalla";
    private static final CardStrings cardStrings;

    public FireOfLove_Eyjafjalla(){
        super(ID, cardStrings.NAME,0,cardStrings.DESCRIPTION,CardType.SKILL,CardRarity.RARE,CardTarget.SELF);
        this.baseMagicNumber = 1;
        this.magicNumber = 1;
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
        this.cardsToPreview = new Burn_Eyjafjalla();
        cardsToPreview.upgrade();
    }

    @Override
    public AbstractCard makeCopy() {
        return new FireOfLove_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new DrawCardAction(magicNumber));
        addToBot(new GainEnergyAction(2));
        addToBot(new MakeTempCardInDiscardAction(this.cardsToPreview,1));
        if(isFire()){
            addToBot(new ApplyPowerAction(p,p,new VigorPower(p,this.magicNumber),this.magicNumber));
        }
        addToBot(new IncreaseCardAction(this,0,0,1,0));
        addToBot(new UpgradePreviewCardAction(this));
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeMagicNumber(1);
            this.cardsToPreview.upgrade();
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}




